package data;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import model.FiyatiNeydi;
import service.DAO;

/**
 * Servlet implementation class DbList
 */
@WebServlet("/DbList")
public class DbList extends HttpServlet {
	private static final long serialVersionUID = 1L;

	/**
	 * @see HttpServlet#HttpServlet()
	 */
	public DbList() {
		super();
		// TODO Auto-generated constructor stub
	}

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse
	 *      response)
	 */
	protected void doGet(HttpServletRequest request,
			
		 HttpServletResponse response) throws ServletException, IOException {
		/*
		DAO.insertFiyat(new FiyatiNeydi("iPad", "DubaiFreeshop", "omer", 12354D));
		DAO.insertFiyat(new FiyatiNeydi("iPhone", "DubaiFreeshop", "omer",
				12354D));
		DAO.insertFiyat(new FiyatiNeydi("macbook", "ny migros", "omer", 12354D));
		DAO.insertFiyat(new FiyatiNeydi("conon 450d", "b n h", "omer", 12354D));
		DAO.insertFiyat(new FiyatiNeydi("fasulya", "g�k�e", "omer", 12354D));
		List<FiyatiNeydi> list = DAO.getFiyatlar();
		System.out.println("");*/
		// request.setAttribute("data", DAO.getFiyatlar());
		// getServletContext().getRequestDispatcher("/view/fiyatlar.jsp");//.forward(request,
		// response);

		/*
		 * Mongo m = new Mongo(); DB db = m.getDB("fiyatiNeydi"); Set<String>
		 * colls = db.getCollectionNames();
		 * 
		 * for (String s : colls) { System.out.println(s); }
		 * 
		 * DBCollection coll = db.getCollection("fiyatlar");
		 * System.out.println(coll.getCount()); DBCursor cur = coll.find();
		 * 
		 * while(cur.hasNext()) { System.out.println(cur.next());
		 * System.out.println(cur.next().get("market")); }
		 */
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse
	 *      response)
	 */
	protected void doPost(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

}
